﻿using MediatR;

namespace EMall.Events
{
    public class EventBus : Mediator, IEventBus
    {
        public EventBus(IServiceProvider serviceProvider) : base(serviceProvider) { }
        public async Task PublishAsync<TEvent>(TEvent @event) where TEvent : class, IEvent
        {
            if (@event is INotification)
            {
                await Publish((INotification)@event);
            }
        }
    }
}
